/******************************************************************************* 
 * Copyright (c) 2008 xored software, Inc.  
 * 
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Eclipse Public License v1.0 
 * which accompanies this distribution, and is available at 
 * http://www.eclipse.org/legal/epl-v10.html  
 * 
 * Contributors: 
 *     xored software, Inc. - initial API and Implementation (Yuri Strot) 
 *******************************************************************************/
package com.xored.glance.internal.core;

import org.eclipse.jface.viewers.StyledString.Styler;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.TextStyle;

/**
 * @author Yuri Strot
 * 
 */
public class ColorStyler extends Styler {

	private Color bColor;
	private Color fColor;

	public ColorStyler(Color bColor, Color fColor) {
		this.bColor = bColor;
		this.fColor = fColor;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.eclipse.jface.viewers.StyledString.Styler#applyStyles(org.eclipse
	 * .swt.graphics.TextStyle)
	 */
	@Override
	public void applyStyles(TextStyle textStyle) {
		textStyle.foreground = fColor;
		textStyle.background = bColor;
	}

}
